package v3.chapter7.stateTest4;

public class Run {

	// NEW,
	// RUNNABLE,
	// TERMINATED,

	// BLOCKED,
	// WAITING,
	// TIMED_WAITING, 
	public static void main(String[] args) {
		try {
			MyThread t=new MyThread();
			t.start();
			Thread.sleep(1000);
			System.out.println("main方法中的t状态：" + t.getState());
		}catch(InterruptedException e) {
			e.printStackTrace();
		}
	}
}

class MyThread extends Thread{
	@Override
	public void run() {
		try {
			synchronized(Lock.lock) {
				Lock.lock.wait();
			}
		}catch(InterruptedException e) {
			e.printStackTrace();
		}
	}
}

class Lock{
	public static final Byte lock=new Byte("0");
}